package com.spring.until;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;

public class UserPass {
    private boolean kind;
    private String count;

    public static UserPass getUserPass(HttpServletRequest request){
        boolean kind = Boolean.parseBoolean(request.getParameter("kind"));
        String userpass = request.getParameter("userPass") ;
        return new UserPass(kind,userpass) ;
    }

    public UserPass(boolean kind, String count){
        this.kind = kind ;
        this.count = count ;
    }

    public boolean getKind() {
        return kind;
    }

    public void setKind(boolean kind) {
        this.kind = kind;
    }

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserPass userPass = (UserPass) o;
        return kind == userPass.kind && Objects.equals(count, userPass.count);
    }

    @Override
    public int hashCode() {
        return Objects.hash(kind, count);
    }
}
